From 17842893306410f878eed66af5e807870e61cc49 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 21 Feb 2022 19:34:01 +0100
Subject: refactor: replace script tags with next/script (#10)

* refactor: replace script tags with next/script

Since next.js v12.1.0 some warnings was displayed because I was using
some script tags.

* build(deps): bump next-themes to v0.1.1
---
 src/pages/article/[slug].tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/pages/article/[slug].tsx')

diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx
index 2fd1850..6d0ad5a 100644
--- a/src/pages/article/[slug].tsx
+++ b/src/pages/article/[slug].tsx
@@ -28,6 +28,7 @@ import { useEffect } from 'react';
 import { useIntl } from 'react-intl';
 import { Blog, BlogPosting, Graph, WebPage } from 'schema-dts';
 import '@utils/plugins/prism-color-scheme';
+import Script from 'next/script';
 
 const SingleArticle: NextPageWithLayout<ArticleProps> = ({
   comments,
@@ -168,11 +169,12 @@ const SingleArticle: NextPageWithLayout<ArticleProps> = ({
         <meta property="og:description" content={intro} />
         <meta property="og:image" content={featuredImage?.sourceUrl} />
         <meta property="og:image:alt" content={featuredImage?.altText} />
-        <script
-          type="application/ld+json"
-          dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
-        ></script>
       </Head>
+      <Script
+        id="schema-article"
+        type="application/ld+json"
+        dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
+      />
       <article
         id="article"
         className={styles.article}
-- 
cgit v1.2.3

